package com.atchangsha.system.entity;

import com.atchangsha.system.vo.PointVO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 卓越班项目第二组
 * @date 2022-05-12 21:15:33
 */
@Data
@TableName("point")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PointEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@TableId(type = IdType.AUTO)
	private Long id;
	/**
	 * 可变积分
	 */
	private Long point;
	/**
	 * 总积分
	 */
	private long pointSum;

	/**
	 * 将entity对象转换成VO对象
	 *
	 * @return VO对象
	 */
	public PointVO toEntity(){
		return PointVO.builder()
				.id(id)
				.point(point)
				.pointSum(pointSum)
				.build();
	}

}
